#include "day5.h"
#include <QApplication>

#include <CommonLib/MainWindow/MainWindow.h>
#include <CommonLib/ListWidget/ListWidget.h>
#include <CommonLib/Callback/Callback.h>
#include <CommonLib/EventHandle/EventHandle.h>
#include "EventControl.h"

int day5( int argc, char **argv )
{
    QApplication app(argc, argv);
    CMainWindow mainWindow;
    CListWidget listWidget(&mainWindow);

    osg::ref_ptr<CHandleControl> rpHandle = new CHandleControl;
    CEventControl eventControl(&listWidget);
    mainWindow.getViewer()->addEventHandler(rpHandle.get());
    rpHandle->setEventConnect(&eventControl);
    mainWindow.home();
    mainWindow.setGeometry( 560, 240, 800, 600 );
    mainWindow.show();
    return app.exec();
}
